package net.huashitong.supervision.task.dao;

import com.sirdc.modules.core.dao.GenericQuery;
import com.sirdc.modules.core.dao.StringDao;
import net.huashitong.supervision.task.entity.ReadDocEntity;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: ling
 * Date: 2019/12/26
 * Time: 16:14
 * To change this template use File | Settings | File Templates.
 * Description:
 */
@Repository
public class ReadDocDao extends StringDao<ReadDocEntity> {
    public List<ReadDocEntity> getByCreateUser(String createUserId) {
        GenericQuery obj = createQuery("obj");
        obj.append(" and del is null ");
        obj.append(" and createUserId =:createUserId").setParam("createUserId", createUserId);
        return obj.listResult();
    }

    public List<ReadDocEntity> getByLeaderId(String leaderId) {
        GenericQuery obj = createQuery("obj");
        obj.append(" and del is null ");
        obj.append(" and leaderId =:leaderId").setParam("leaderId", leaderId);
        return obj.listResult();
    }
}
